package com.mall.app.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;

import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * <p>
 * 订单表
 * </p>
 *
 * @author LeeSin
 * @since 2020-07-10
 */
@ApiModel(value="TbOrder对象", description="订单表")
public class TbOrder extends Model<TbOrder> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "订单编号")
    @TableId(value = "oid", type = IdType.AUTO)
    private Integer oid;

    @ApiModelProperty(value = "商品")
    private TbGoods goods;

    @ApiModelProperty(value = "处理订单的管理员")
    private TbUser user;

    @ApiModelProperty(value = "物流公司")
    private TbLogistic logistic; 

    @ApiModelProperty(value = "顾客")
    private TbBuyer buyer;

    @ApiModelProperty(value = "订单创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "订单修改时间")
    private LocalDateTime modifyTime;

    @ApiModelProperty(value = "订单状态:0->待付款；1->待发货；2->已发货；3->已完成；4->已取消")
    private Integer stat;
    @TableLogic
    private Integer deleted;

    @ApiModelProperty(value = "商品数量")
    private Integer goodsQuantity;


    public Integer getOid() {
        return oid;
    }

    public void setOid(Integer oid) {
        this.oid = oid;
    }

    public TbGoods getGoods() {
		return goods;
	}

	public void setGoods(TbGoods goods) {
		this.goods = goods;
	}

	public TbUser getUser() {
		return user;
	}

	public void setUser(TbUser user) {
		this.user = user;
	}

	public TbLogistic getLogistic() {
		return logistic;
	}

	public void setLogistic(TbLogistic logistic) {
		this.logistic = logistic;
	}

	public TbBuyer getBuyer() {
		return buyer;
	}

	public void setBuyer(TbBuyer buyer) {
		this.buyer = buyer;
	}

	public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(LocalDateTime modifyTime) {
        this.modifyTime = modifyTime;
    }

    public Integer getStat() {
        return stat;
    }

    public void setStat(Integer stat) {
        this.stat = stat;
    }

    public Integer getDeleted() {
        return deleted;
    }

    public void setDeleted(Integer deleted) {
        this.deleted = deleted;
    }

    public Integer getGoodsQuantity() {
        return goodsQuantity;
    }

    public void setGoodsQuantity(Integer goodsQuantity) {
        this.goodsQuantity = goodsQuantity;
    }

    @Override
    protected Serializable pkVal() {
        return this.oid;
    }

    @Override
    public String toString() {
        return "TbOrder{" +
        "oid=" + oid +
        ", goods=" + goods.toString() +
        ", user=" + user.toString() +
        ", logi=" + logistic.toString() +
        ", buyer=" + buyer.toString() +
        ", createTime=" + createTime +
        ", modifyTime=" + modifyTime +
        ", stat=" + stat +
        ", deleted=" + deleted +
        ", goodsQuantity=" + goodsQuantity +
        "}";
    }
}
